package com.rockxin.cat.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rockxin.cat.R;
import com.rockxin.cat.bean.BidLogBean;

import java.util.List;

/**
 * <b>类名称：    BidLogAdapter             <br/>
 * <b>类描述：                        <br/>
 * <b>创建人：    Lans               <br/>
 * <b>创建时间：  2018/3/5 10:48     <br/>
 * <b>修改人：                        <br/>
 * <b>修改时间：                      <br/>
 * <b>修改备注：                      <br/>
 *
 * @version 1.0.0 <br/>
 */
public class BidLogAdapter extends BaseQuickAdapter<BidLogBean, BaseViewHolder> {
    public BidLogAdapter(@Nullable List<BidLogBean> data) {
        super(R.layout.fragment_bid_log_item, data);
    }

    @Override
    protected void convert(BaseViewHolder viewHolder, BidLogBean item) {
        StringBuilder sb = new StringBuilder(item.getMobile());
        sb.replace(3, 7, "****");
        viewHolder.setText(R.id.tv_phone, sb)
                .setText(R.id.tv_money_num, "¥" + item.getMoney())
                .setText(R.id.tv_date, item.getCreate_time());

        Glide.with(mContext).load(item.getAvatar()).into((ImageView) viewHolder.getView(R.id.iv_icon));
    }
}
